<template>
  <ul>
    <li style="list-style:none;padding-top:1rem;" v-for='(item,index) in products' :key="index">
      <img :src='item.img' :title="item.name" width="100%">
    </li>
  </ul>  
</template>

<script lang="ts">


export default ({
    name:'list2',
    data:function(){
       return {
          products:[
            {name:'商品1',img:'https://h2.appsimg.com/a.appsimg.com/upload/brand/upcb/2022/03/19/102/ias_7479f35eb78bf279804e83203224ebca_1135x545_85.jpg'},
            {name:'商品1',img:'https://h2.appsimg.com/a.appsimg.com/upload/brand/upcb/2022/03/19/102/ias_7479f35eb78bf279804e83203224ebca_1135x545_85.jpg'},
            {name:'商品1',img:'https://h2.appsimg.com/a.appsimg.com/upload/brand/upcb/2022/03/19/102/ias_7479f35eb78bf279804e83203224ebca_1135x545_85.jpg'}
          ]
       }
    },
    mounted:function(){
      console.log('创建了！',this)
      //console.log(window)
      //console.log(this.router) 错误
      console.log(this.$router)
      window.route2=this.$route;
      window.router2=this.$router;
    },
    beforeDestroy:function(){
      console.log("销毁了");
    }
})
</script>
